package cn.com.surker.lab.entity;

import cn.com.surker.base.BaseEntity;
import com.baomidou.mybatisplus.annotation.IdType;

import java.time.LocalDate;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;

import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;

/**
 * <p>
 * 强度等级优化表(用于上传到检查平台)
 * </p>
 *
 * @author admin
 * @since 2024-09-23
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class LabLevelOptimize extends BaseEntity implements Serializable {

	private static final long serialVersionUID = 1L;

	/**
	 * 标识
	 */
	@TableId(value = "id", type = IdType.AUTO)
	private Long id;

	/**
	 * 公司ID
	 */
	private Long orgId;

	/**
	 * 配合比编号
	 */
	private String code;
	/**
	 * 实验室配比编号
	 */
	private String labCode;

	/**
	 * 强度等级
	 */
	@NotNull(message = "请选择强度")
	private Long strengthId;

	/**
	 * 设计塌落度
	 */
	private String designSlump;

	/**
	 * 实际塌落度
	 */
	private String theorySlump;

	/**
	 * 检验日期
	 */
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date inspectionDate;

	/**
	 * 适应季节
	 */
	private String season;
	/**
	 * 生效日期
	 */
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date takeEffectDate;

	/**
	 * 浇筑方式
	 */
	private Long castModeId;

	/**
	 * 初凝时间(分钟)
	 */
	private Integer initialSettingTime;

	/**
	 * 初凝时间(分钟)
	 */
	private Integer finalSettingTime;

	/**
	 * 搅拌时间(秒)
	 */
	@NotNull(message = "请输入搅拌时间(秒)")
	private Integer mixTime;

	/**
	 * 容重
	 */
	@NotNull(message = "请输入容重(KG)")
	private Double volumeWeight;

	/**
	 * 最小容重
	 */
	private Double minDosage;
	/**
	 * 最大容重
	 */
	private Double maxDosage;

	/**
	 * 密度
	 */
	private Double density;

	/**
	 * 水灰比
	 */
	private String ratio1;

	/**
	 * 水胶比
	 */
	private String ratio2;

	/**
	 * 配合比(1:2:1.5这种)
	 */
	private String mixRatio;

	/**
	 * 砂率
	 */
	private Double sandRate;

	/**
	 * 误差率(%)
	 */
	private Double testMpa;

	/**
	 * 试验人员
	 */
	private String testUser;

	/**
	 * 负责人员
	 */
	private String responsibler;

	/**
	 * 校队人员
	 */
	private String verificationer;

	/**
	 * 审核人员
	 */
	private String examiner;

	/**
	 * 是否启用
	 */
	private Integer enable;

	@TableField(exist = false)
	private List<LabLevelOptimizeMaterial> list = new ArrayList<>();
	public LabLevelOptimize(){}

	public LabLevelOptimize(Long orgId, String code, Long strengthId, String designSlump, String theorySlump,
							Date inspectionDate, String season, Date takeEffectDate, Long castModeId,
							Integer initialSettingTime, Integer finalSettingTime, Integer mixTime, Double volumeWeight,
							Double minDosage, Double maxDosage, Double density, String ratio1, String ratio2,
							String mixRatio, Double sandRate, Integer enable, Double testMpa) {
		this.orgId = orgId;
		this.code = code;
		this.strengthId = strengthId;
		this.designSlump = designSlump;
		this.theorySlump = theorySlump;
		this.inspectionDate = inspectionDate;
		this.season = season;
		this.takeEffectDate = takeEffectDate;
		this.castModeId = castModeId;
		this.initialSettingTime = initialSettingTime;
		this.finalSettingTime = finalSettingTime;
		this.mixTime = mixTime;
		this.volumeWeight = volumeWeight;
		this.minDosage = minDosage;
		this.maxDosage = maxDosage;
		this.density = density;
		this.ratio1 = ratio1;
		this.ratio2 = ratio2;
		this.mixRatio = mixRatio;
		this.sandRate = sandRate;
		this.enable = enable;
		this.testMpa = testMpa;
	}
}
